package aiku.numericalcontroloa.Controller.AfterController;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Entity.AfterRecords;
import aiku.numericalcontroloa.Service.AfterRecordsService;
import aiku.numericalcontroloa.Service.Impl.AfterRecordsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 马文杰
 * @version 1.0
 */
@RestController
@RequestMapping("/afterRecords")
public class AfterRecordsController {
    @Autowired
    private AfterRecordsServiceImpl afterRecordsService;


    /**
     * 通过派单id添加交流记录
     * @return
     */
    @RequestMapping("addExchange")
    public Result afterRecords(@RequestBody AfterRecords afterRecords) {
        return afterRecordsService.addExchange(afterRecords);
    }

    /**
     * 根据派单id查询交流记录
     */
    @RequestMapping("selectExchange")
        public Result selectExchange(@RequestParam("afterSalesId") String afterSalesId) {
        return afterRecordsService.selectExchange(afterSalesId);
    }

}
